import { createApp } from 'vue';
import { createPinia } from 'pinia';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import App from './App.vue';
import router from './router';
import 'element-plus/dist/index.css';

const app = createApp(App);
app.use(createPinia());
app.use(router);

// 注册elementplus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}


import { useUserStore } from './store/user';
// 如果需要在挂载之前做些什么
(async function () {
  // try {
      const userStore = useUserStore()
      userStore.updateUser({ version: import.meta.env.VITE_NAME })
  // } catch (error) {
      
  // } finally {
      app.mount('#app')
  // }
})()




